<?php
/*
 * employe/fire.phtml
 */
?>
<?php
$employe = $this->employe;
?>
<div>
    <div class="content-head">
	<h4 style='text-align: center;'>Voulez-vous terminer le contrat de l'Employé <br><span class='name'><?php echo $employe->prenom . ' ' . $employe->nom1 . ' ' . $employe->nom2; ?></span> ?</h4>
    </div>
    <div class='content-body'>
	<button class='btn btn-success yes'>Oui</button>
	<button class='btn btn-inverse no'>Non</button>
    </div>
</div>
<script type='text/javascript'>
    $(function() {
	// Validation
	$('.yes').click(function(e) {
	    e.preventDefault();
	    remover = $.ajax({
		type: 'post',
		url: '<?php echo $this->url('RHX/default', array('controller'	 => 'employe', 'action'	 => 'fireEmploye', 'id'		 => $employe->matricule)) ?>'
	    });
	    remover.success(function() {
		$('#dialog1').dialog('close');
		refresh();
		updateAllPlanningType();
	    });
	    // Ferméture et rafraichissement
	    $('#dialog1').dialog('close');
	    refresh();
	});
	// Annulation
	$('.no').click(function(e) {
	    e.preventDefault();
	    $('#dialog1').dialog('close');
	});
    });
</script>
<style type='text/css'>
    .yes, .no{
	margin: 5px;
	float: right;
    }
    .name{
	color: #3300ff;
	font-weight: bolder;
    }
</style>